package com.se.frontline.gameplay.units;

import org.andengine.entity.modifier.MoveXModifier;
import org.andengine.entity.sprite.AnimatedSprite;
import org.andengine.entity.sprite.AnimatedSprite.IAnimationListener;
import org.andengine.entity.sprite.Sprite;
import org.andengine.entity.sprite.TiledSprite;

import com.se.frontline.gameplay.ManagedGameScene;
import com.se.frontline.managers.ResourceManager;

public class Tower extends Unit {

	private AnimatedSprite TowerSprite;
	private MoveXModifier move;
	public float Height;
	public float Width;
	private boolean isEnemy;
	// ====================================================
	// Statistics of this Unit
	// ====================================================

	private int Health;
	private int Damage;
	private int Armor;

	public Tower(boolean pIsEnemy) {

		isEnemy = pIsEnemy;
		if (isEnemy == false) {

			TowerSprite = new AnimatedSprite(0, 0,
					ResourceManager.getInstance().towerTextureRegion,
					ResourceManager.getInstance().engine
							.getVertexBufferObjectManager());
			TowerSprite.setFlippedHorizontal(true);
		}
		
		if (isEnemy == true) {

			TowerSprite = new AnimatedSprite(1500, 0,
					ResourceManager.getInstance().towerTextureRegion,
					ResourceManager.getInstance().engine
							.getVertexBufferObjectManager());
			TowerSprite.setFlippedHorizontal(false);
		}
		
		this.Height = TowerSprite.getHeight();
		this.Width = TowerSprite.getWidth();
		ResourceManager.getInstance().getGameGround().attachChild(TowerSprite);

	}

	@Override
	public float getHeight() {
		return Height;
	}

}
